package com.webex.ta.hydra.gui.table;

import com.webex.ta.hydra.gui.GuiPackage;

import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: vegaz
 * Date: 2010-9-1
 * Time: 13:04:52
 * To change this template use File | Settings | File Templates.
 */
public class HydraTableTransferable implements Transferable {
    public int[] getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
        GuiPackage gp = GuiPackage.getInstance();
        return gp.getHydraTable().getSelectedRows();
    }

    public DataFlavor[] getTransferDataFlavors() {
        return new DataFlavor[]{DataFlavor.stringFlavor};
    }

    public boolean isDataFlavorSupported(DataFlavor flavor) {
//        if (flavor == DataFlavor.stringFlavor)
            return true;
//        return false;
    }
}
